package com.hy.erp.inventory.pojo;

import java.math.BigDecimal ;
import java.util.Date ;
import java.util.List ;

import javax.persistence.Column ;
import javax.persistence.Entity ;
import javax.persistence.FetchType ;
import javax.persistence.NamedQueries ;
import javax.persistence.NamedQuery ;
import javax.persistence.OneToMany ;
import javax.persistence.OneToOne ;
import javax.persistence.PrimaryKeyJoinColumn ;
import javax.persistence.Table ;
import javax.persistence.Temporal ;
import javax.persistence.TemporalType ;

import org.hibernate.annotations.Index ;
/*import org.jboss.seam.ScopeType ;
import org.jboss.seam.annotations.Name ;
import org.jboss.seam.annotations.Scope ;
*/
import com.hy.erp.inventory.dao.interfaces.IMaterielDao;
import com.hy.erp.inventory.pojo.interfaces.IMateriel;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.api.annotation.DaoA;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.entity.AbstractPersistentEntity;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;

/**
 * 物料
 * @author Administrator
 *
 */
/*@ NamedQueries (
            	{
            		@ NamedQuery ( name = "selectMaterielByMaterielType" , query = "SELECT"
            															+ " materiel"
            															+ " FROM"
            															+ " com.pojo.Materiel materiel"
            															+    " WHERE"
            															+ " materiel.materielType = :materielType"
            															

            		),@ NamedQuery ( name = "selectMaterielBydepot" , query = "SELECT"
						+ " materiel"
						+ " FROM"
						+ " com.pojo.Materiel materiel WHERE materiel.identifier IN ("
						+ " SELECT"
						+ " inventoryDepot.materiel.identifier"
						+ " FROM"
						+ " com.pojo.depotallocate.InventoryDepot inventoryDepot"
						+ " WHERE"
						+ " inventoryDepot.depot.identifier = :depotidentifier )"

),
            
            		@ NamedQuery ( name = "selectMaterielByRateType" , query = "SELECT"
						+ " materiel"
						+ " FROM"
						+ " com.pojo.Materiel materiel"
						+ " WHERE"
						+ " materiel.rateType = :rateType"
						

)

            
            	} )*/
/*@Entity
@Name("materiel")
@Scope(ScopeType.SESSION)
@Table(name="materiels")
@DaoA(IMaterielDao.class)*/
//public class Materiel extends AbstractPersistentEntity  implements IMateriel{
	public class Materiel extends MyBaseModel //implements IPositonType
	{
	private static final long	serialVersionUID	=
														6236115160468858655L ;
	
	
	
	/**
	 * 构造函数
	 */
	public Materiel(){}
	
	


	//######################################################################
	
	@Column(name="materielcode",unique=false,nullable=true,insertable=true,updatable=true)
	@Index(name="materielcodeIndex")
	public String getMaterielcode ( )
	{
		return this.get(IMateriel.MATERIELCODE) ;
	}

	@Column(name="materielname",unique=false,nullable=true,insertable=true,updatable=true)
	@Index(name="materielnameIndex")
	public String getMaterielname ( )
	{
		return this.get(IMateriel.MATERIELNAME) ;
	}

	

	@Column(name="materialfromdate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getMaterialfromdate ( )
	{
		return this.get(IMateriel.MATERIALFROMDATE) ;
	}

	@OneToOne(targetEntity=MaterielType.class,fetch=FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public MaterielType getMaterielType ( )
	{
		return this.get(IMateriel.MATERIEKTYPE) ;
	}

	@OneToMany(targetEntity=ProductCharacteristic.class,fetch=FetchType.LAZY)
	public List < ProductCharacteristic > getCharacteristic ( )
	{
		return this.get(IMateriel.CHARACTERISTIC);
	}

	@OneToMany(targetEntity=Supplier.class,fetch=FetchType.LAZY)
	public List < Supplier > getSupplier ( )
	{
		return this.get(IMateriel.SUPPLIER) ;
	}
	
	@OneToMany(targetEntity=Customer.class,fetch=FetchType.LAZY)
	public List < Customer > getCustomer ( )
	{
		return this.get(IMateriel.CUSTOMER) ;
	}

	@OneToOne(targetEntity=Units.class,fetch=FetchType.LAZY)
	public  Units  getUnits ( )
	{
		return this.get(IMateriel.UNITS) ;
	}

	@Column(name="produceBlueprint",unique=false,nullable=true,insertable=true,updatable=true)
	public String getProduceBlueprint ( )
	{
		return this.get(IMateriel.PRODUCEBLUEPRINT) ;
	}

	@Column(name="produceImage",unique=false,nullable=true,insertable=true,updatable=true)
	public String getProduceImage ( )
	{
		return this.get(IMateriel.PRODUCEIMAGE) ;
	}

	@Column(name="produceDocument",unique=false,nullable=true,insertable=true,updatable=true)
	public String getProduceDocument ( )
	{
		return this.get(IMateriel.PRODUCEDOCUMENT) ;
	}

	@Column(name="produceDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getProduceDate ( )
	{
		return this.get(IMateriel.PRODUCTDATE) ;
	}

	@Column(name="sellDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getSellDate ( )
	{
		return this.get(IMateriel.SELLDATE) ;
	}

	@Column(name="stopProduceDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getStopProduceDate ( )
	{
		return this.get(IMateriel.STOPPRODUCEDATE) ;
	}

	@Column(name="stopSellDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getStopSellDate ( )
	{
		return this.get(IMateriel.STOPSELLDATE) ;
	}

	@Column(name="guaranteePeriod",unique=false,nullable=true,insertable=true,updatable=true)
	public Integer getGuaranteePeriod ( )
	{
		return this.get(IMateriel.GURANTEEPERIOD) ;
	}

	@Column(name="guaranteePeriodWarning",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isGuaranteePeriodWarning ( )
	{
		return this.get(IMateriel.GUARANTEEPERIODWARNING) ;
	}

	@Column(name="wastageRate",unique=false,nullable=true,insertable=true,updatable=true)
	public BigDecimal getWastageRate ( )
	{
		return this.get(IMateriel.WASTAGERATE) ;
	}

	@Column(name="batchNumberManage",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isBatchNumberManage ( )
	{
		return this.get(IMateriel.BATCHNUMBERMANAGE) ;
	}

	@Column(name="stockSafeWarning",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isStockSafeWarning ( )
	{
		return this.get(IMateriel.STORKSAFEWARNING) ;
	}

	@Column(name="description",unique=false,nullable=true,insertable=true,updatable=true)
	public String getDescription ( )
	{
		return this.get(IMateriel.DESCRIPTION) ;
	}

	@Column(name="remark",unique=false,nullable=true,insertable=true,updatable=true)
	public String getRemark ( )
	{
		return this.get(IMateriel.REMARK) ;
	}

	@OneToMany(targetEntity=Person.class,fetch=FetchType.LAZY)
	public List < Person > getPerson ( )
	{
		return this.get(IMateriel.PERSON) ;
	}
	
	@OneToOne(targetEntity=RateType.class,fetch=FetchType.LAZY)
	public  RateType  getRateType ( )
	{
		return this.get(IMateriel.RATE_TYPE) ;
	}
	
	public void setRateType (
									RateType rateType )
	{
		super.set ( IMateriel.RATE_TYPE , rateType );
	}
	
	
	@Column(name="writeDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getWriteDate ( )
	{
		return this.get(IMateriel.WRITEDATE) ;
	}

	@Column(name="detailSheetDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getDetailSheetDate ( )
	{
		return this.get(IMateriel.DETAILSHEETDATE) ;
	}
	
	@Column(name="batchNumber",unique=false,nullable=true,insertable=true,updatable=true)
	public String getBatchNumber ( )
	{
		return this.get(IMateriel.BATCHNUMBER) ;
	}
	
	
	
	@Column(name="maxInventoryAmount",unique=false,nullable=true,insertable=true,updatable=true)
	public Integer getMaxInventoryAmount ( )
	{
		return this.get(IMateriel.MAX_INVENTORY_AMOUNT) ;
	}
	@Column(name="minInventoryAmount",unique=false,nullable=true,insertable=true,updatable=true)
	public Integer getMinInventoryAmount ( )
	{
		return this.get(IMateriel.MIN_INVENTORY_AMOUNT) ;
	}
	
	@Column(name="safetyInventoryAmount",unique=false,nullable=true,insertable=true,updatable=true)
	public Integer getSafetyInventoryAmount ( )
	{
		return this.get(IMateriel.SAFETY_INVENTORY_AMOUNT) ;
	}
	
	
	//#####################################################################3

	public void setMaxInventoryAmount (
									Integer maxInventoryAmount )
	{
		super.set ( IMateriel.MAX_INVENTORY_AMOUNT , maxInventoryAmount );
	}
	public void setMinInventoryAmount (
										Integer minInventoryAmount )
		{
			super.set ( IMateriel.MIN_INVENTORY_AMOUNT , minInventoryAmount );
		}
		public void setSafetyInventoryAmount (
											Integer safetyInventoryAmount )
			{
				super.set ( IMateriel.SAFETY_INVENTORY_AMOUNT , safetyInventoryAmount );
			}
	public void setMaterielcode (
									String materielcode )
	{
		super.set ( IMateriel.MATERIELCODE , materielcode );
	}

	public void setMaterielname (
									String materielname )
	{
		super.set ( IMateriel.MATERIELNAME , materielname );
	}

	

	public void setMaterialfromdate (
										Date materialfromdate )
	{
		super.set ( IMateriel.MATERIALFROMDATE , materialfromdate );
	}

	public void setMaterielType (
									MaterielType materielType )
	{
		super.set ( IMateriel.MATERIEKTYPE , materielType );
	}

	public void setCharacteristic (
									List < ProductCharacteristic > characteristic )
	{
		super.set ( IMateriel.CHARACTERISTIC , characteristic );
	}

	public void setSupplier (
								List < Supplier > supplier )
	{
		super.set ( IMateriel.SUPPLIER , supplier );
	}

	public void setCustomer (
								List < Customer > customer )
	{
		super.set ( IMateriel.CUSTOMER , customer );
	}

	public void setUnits (
							Units  units )
	{
		super.set ( IMateriel.UNITS , units );
	}

	public void setProduceBlueprint (
										String produceBlueprint )
	{
		super.set ( IMateriel.PRODUCEBLUEPRINT , produceBlueprint );
	}

	public void setProduceImage (
									String produceImage )
	{
		super.set ( IMateriel.PRODUCEIMAGE , produceImage );
	}

	public void setProduceDocument (
										String produceDocument )
	{
		super.set ( IMateriel.PRODUCEDOCUMENT , produceDocument );
	}

	public void setProduceDate (
									Date produceDate )
	{
		super.set ( IMateriel.PRODUCTDATE , produceDate );
	}

	public void setSellDate (
								Date sellDate )
	{
		super.set ( IMateriel.SELLDATE , sellDate );
	}

	public void setStopProduceDate (
										Date stopProduceDate )
	{
		super.set ( IMateriel.STOPPRODUCEDATE , stopProduceDate );
	}

	public void setStopSellDate (
									Date stopSellDate )
	{
		super.set ( IMateriel.STOPSELLDATE , stopSellDate );
	}

	public void setGuaranteePeriod (
										Integer guaranteePeriod )
	{
		super.set ( IMateriel.GURANTEEPERIOD , guaranteePeriod );
	}

	public void setGuaranteePeriodWarning (
											Boolean guaranteePeriodWarning )
	{
		super.set ( IMateriel.GUARANTEEPERIODWARNING , guaranteePeriodWarning );
	}

	public void setWastageRate (
									BigDecimal wastageRate )
	{
		super.set ( IMateriel.WASTAGERATE , wastageRate );
	}

	public void setBatchNumberManage (
										Boolean batchNumberManage )
	{
		super.set ( IMateriel.BATCHNUMBERMANAGE , batchNumberManage );
	}

	public void setStockSafeWarning (
										Boolean stockSafeWarning )
	{
		super.set ( IMateriel.STORKSAFEWARNING , stockSafeWarning );
	}

	public void setDescription (
									String description )
	{
		super.set ( IMateriel.DESCRIPTION , description );
	}

	public void setRemark (
							String remark )
	{
		super.set ( IMateriel.REMARK , remark );
	}

	public void setPerson (
							List < Person > person )
	{
		super.set ( IMateriel.PERSON , person );
	}

	public void setWriteDate (
								Date writeDate )
	{
		super.set ( IMateriel.WRITEDATE , writeDate );
	}

	public void setDetailSheetDate (
										Date detailSheetDate )
	{
		super.set ( IMateriel.DETAILSHEETDATE , detailSheetDate );
	}


	public void setBatchNumber (
									String batchNumber )
	{
		super.set ( IMateriel.BATCHNUMBER , batchNumber );
	}

	@Column(name="price",unique=false,nullable=true,insertable=true,updatable=true)
	public BigDecimal getPrice()
	{
		return this.get ( IMateriel.PRICE );
	}
	public void setPrice(BigDecimal price)
	{
		super.set ( IMateriel.PRICE , price );
	}
	
	
	//规格型号
	@Column(name="specificationModel",unique=false,nullable=true,insertable=true,updatable=true)
	public String getSpecificationModel()
	{
		return this.get ( IMateriel.SPECIFICATIONMODEL );
	}
	public void setSpecificationModel(String specificationModel)
	{
		super.set ( IMateriel.SPECIFICATIONMODEL , specificationModel );
	}
	//重要程度
	@Column(name="materialitylevel",unique=false,nullable=true,insertable=true,updatable=true)
	public String getMaterialityOLevel()
	{
		return this.get ( IMateriel.MATERIALITYLEVEL );
	}
	public void setMaterialityOLevel(String materialitylevel)
	{
		super.set ( IMateriel.MATERIALITYLEVEL , materialitylevel );
	}
}
